<template>
  <div class="about">
    <h1>页面2</h1>
    <div>
      {{ getWebsocketInstance }}
    </div>
    <div>
      msg： {{msg}}
    </div>
  </div>
</template>
<script>
export  default {
  data() {
    return {
      // websocketInstance: {}
      msg: null
    }
  },
  computed: {
    getWebsocketInstance(){
      console.log(this.$store.state.websocketInstance)
      return this.$store.state.websocketInstance;
    }
  },
  mounted() {
    this.getWebsocketInstance.onmessage = (e => {
      console.log(e.data)
      this.msg = e.data;
    })
  }
}
</script>
